package com.imooc.coupon.dao;

import com.imooc.coupon.entity.CouponTemplate;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * <h1>CouponTemplate dao 接口定义</h1>
 * @Author: crowsjian
 * @Date: 2020/6/4 22:33
 */
public interface CouponTemplateDao extends JpaRepository<CouponTemplate,Integer> {
    /*
    * <h2>根据模板名称查询模板</h2>
    * */
    CouponTemplate findByName(String name);

    /*
    <h2>根据 available 和 expired 标记查找模板记录</h2>
    */
    List<CouponTemplate> findAllByAvailableAndExpired(Boolean available, Boolean expired);

    /*
   <h2>根据 expired 标记查找模板记录</h2>
   */
    List<CouponTemplate> findAllByExpired(Boolean expired);
}
